home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / ab20_archive / languages / assembly / powervisor_113.lzh / Source / GetQual.c < prev    next >
C/C++ Source or Header  |  1991-09-15  |  822b  |  54 lines

  1. /* Routine to get the named qualifier value
  2.  
  3. Compile with :
  4.     lc -v -cmsw -O GetQual
  5.     blink GetQual.o to GetQual lib pv:pvdevelop/lib/PVCallStub.lib
  6. */
  7.  
  8.  
  9. #include <exec/types.h>
  10. #include "pv:PVDevelop/include/PV/pvcallroutines.h"
  11. #include <pragmas/exec.h>
  12. #include <pragmas/keymap.h>
  13. #include <string.h>
  14.  
  15. APTR PVCallTable;
  16.  
  17. struct myQual
  18.     {
  19.         char *str;
  20.         UWORD qual;
  21.     };
  22.  
  23. struct myQual Quals[] =
  24.     {
  25.         "lshift",    0x1,
  26.         "rshift",    0x2,
  27.         "ctrl",        0x8,
  28.         "lalt",        0x10,
  29.         "ralt",        0x20,
  30.         "lcmd",        0x40,
  31.         "rcmd",        0x80,
  32.         NULL,            0
  33.     };
  34.  
  35.  
  36. int __saveds __asm Qual (register __a0 char *cmdline, register __a2 APTR table[])
  37. {
  38.     char *p;
  39.     struct myQual *mq;
  40.  
  41.     PVCallTable = table;
  42.  
  43.     p = PVCParseString (cmdline);
  44.  
  45.     mq = Quals;
  46.     while (mq->str)
  47.         {
  48.             if (!strcmp (mq->str,p)) return ((int)(mq->qual));
  49.             mq++;
  50.         }
  51.  
  52.     return (0);
  53. }
  54.